<% layout('/layouts/default.html', {title: '小区楼宇管理', libs: ['validate']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa icon-note"></i> ${text(abFloorTree.isNewRecord ? '新增小区楼宇' : '编辑小区楼宇')}
			</div>
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
			</div>
		</div>
		<#form:form id="inputForm" model="${abFloorTree}" action="${ctx}/ab/abFloorTree/save" method="post" class="form-horizontal">
		<div class="box-body">
			<div class="form-unit">${text('基本信息')}</div>
			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4">${text('上级小区楼宇')}：</label>
						<div class="col-sm-8">
							<#form:treeselect id="parent" title="${text('上级小区楼宇')}"
							path="parent.id" labelPath="parent.treeName"
							url="${ctx}/ab/abFloorTree/treeData?excludeCode=${abFloorTree.id}"
							class="" allowClear="true" canSelectRoot="true" canSelectParent="true"/>
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required ">*</span> ${text('节点名称')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="floorName" maxlength="200" class="form-control required"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> 区域选择<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:treeselect id="testAreaCode" title="区域选择"
							path="areaCode" labelPath="areaName"
							url="${ctx}/sys/area/treeData?excludeCode=${abFloorTree.areaCode}"
							class="" allowClear="true"/>
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required ">*</span> ${text('经度')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="lon" class="form-control required number"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required ">*</span> ${text('纬度')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="lat" class="form-control required number"/>
						</div>
					</div>
				</div>
			</div>
			<div class="row">

				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('单元数')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="unitCount" maxlength="11" class="form-control digits"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('楼层数')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="floorCount" maxlength="11" class="form-control digits"/>
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-xs-12">
					<div class="form-group">
						<label class="control-label col-sm-2" title="">
							<span class="required hide">*</span> ${text('备注信息')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-10">
							<#form:textarea path="remarks" rows="4" maxlength="500" class="form-control"/>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="box-footer">
			<div class="row">
				<div class="col-sm-offset-2 col-sm-10">
					<% if (hasPermi('ab:abFloorTree:edit')){ %>
					<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('保 存')}</button>&nbsp;
					<% } %>
					<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
				</div>
			</div>
		</div>
	</#form:form>
</div>
</div>
<% } %>
<script>
	$("#inputForm").validate({
		submitHandler: function(form){
			js.ajaxSubmitForm($(form), function(data){
				js.showMessage(data.message);
				if(data.result == Global.TRUE){
					js.closeCurrentTabPage(function(contentWindow){
						contentWindow.page();
					});
				}
			}, "json");
		}
	});
</script>